package com.len.entity;

import com.len.entity.base.FlexBaseEntity;
import com.len.validator.group.AddGroup;
import com.len.validator.group.UpdateGroup;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import lombok.*;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotEmpty;

@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@Table(value = "sys_user")
@EqualsAndHashCode(callSuper = true)
public class SysUser extends FlexBaseEntity {

    @NotEmpty(message = "用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String username;

    @NotEmpty(message = "密码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String password;

    private Integer age;

    private String email;

    private String photo;

    private String realName;

    /**
     * 员工id
     */
    private String userEmpid;

    /**
     * 0可用1封禁
     */
    @Column(isLogicDelete = true)
    private Integer delFlag;
}